﻿using System;
using System.Windows.Forms;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using YRevitJig;

namespace YArchitech.HVAC
{
	public class QuickLocateJip : XLineJig
	{
		public QuickLocateJip(UIDocument uiDoc) : base(uiDoc)
		{
			base.JigStage = XLineJig.EStage.eNoOper;
		}

		public override void Draw(PaintEventArgs paintEventArgs)
		{
			base.Draw(paintEventArgs);
			if (!this.m_ptCur.IsEmpty && paintEventArgs != null && base.JigStage == XLineJig.EStage.eEndPt)
			{
				XYZ ptUser = base.Client2Revit(this.m_ptCur);
				if (base.ResetPoint == XUiJigBase.EResetPoint.eByAngle)
				{
					XYZ projectPoint = JigFuncs.GetProjectPoint(base.UiDoc, ptUser, base.StartPoint, base.LineAngle);
					this.m_ptCur = base.Revit2Client(projectPoint);
					return;
				}
				if (base.ResetPoint == XUiJigBase.EResetPoint.eByOrtho)
				{
					XYZ orthoPoint = JigFuncs.GetOrthoPoint(base.UiDoc, ptUser, base.StartPoint);
					this.m_ptCur = base.Revit2Client(orthoPoint);
					return;
				}
				if (base.ResetPoint == XUiJigBase.EResetPoint.eByAxis)
				{
					XYZ axisPoint = JigFuncs.GetAxisPoint(base.UiDoc, ptUser, base.StartPoint);
				}
			}
		}
	}
}
